package api

import (
	"git.cloud.inspur.com/ichain/ichain-sdk-go/pkg/common/options"
	"git.cloud.inspur.com/ichain/ichain-sdk-go/pkg/providers/core"
	"git.cloud.inspur.com/ichain/ichain-sdk-go/pkg/providers/iam"
	"git.cloud.inspur.com/ichain/ichain-sdk-go/pkg/providers/ichain"
)

type CoreProviderFactory interface {
	CreateCryptoSuite(config core.CryptoSuiteConfig) (core.CryptoSuite, error)
	CreateSigningManager(cryptoProvider core.CryptoSuite) (core.SigningManager, error)
	CreateIChainProvider(config ichain.EndpointConfig) (ichain.IChainProvider, error)
}

type IAMProviderFactory interface {
	CreateUserStore(config iam.IdentityConfig) (iam.UserStore, error)
	CreateIdentityManagerProvider(config ichain.EndpointConfig, cryptoProvider core.CryptoSuite, userStore iam.UserStore) (iam.IdentityManagerProvider, error)
}

type ServiceProviderFactory interface {
	CreateLocalDiscoveryProvider(config ichain.EndpointConfig) (ichain.LocalDiscoveryProvider, error)
	CreateChainProvider(config ichain.EndpointConfig, opts ...options.Opt) (ichain.ChainProvider, error)
}
